package com.java.CarDemo;

public class FreightCar extends Car implements rent{
    private float carriage;

    public FreightCar() {
    }

    public FreightCar(int carNumber, String brand, String color, double price, float output, float carriage) {
        super(carNumber, brand, color, price, output);
        this.carriage = carriage;
    }

    public float getCarriage() {
        return carriage;
    }

    public void setCarriage(float carriage) {
        this.carriage = carriage;
    }

    @Override
    public float rentPrice() {
        //货车 一天=1200 + 车厢大小 * 80
        return 1200 + carriage * 80;
    }
}
